<template>
	<div>
		<div style="display: inline-block;">
			<div style="position: relative;display: inline-block;margin:5px;">
				<span>是否承担高速费用：</span>
				<el-select v-model="indentState" style="width:150px;margin-left: 10px;" @change="select()">
					<el-option v-for="item in statesnum1" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;
			</div>
			<div style="position: relative;display: inline-block;margin:5px;">
				<span>用户昵称:</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入用户昵称"
					v-model="riderNickName">
				</el-input>&nbsp;&nbsp;
			</div>
			<div style="position: relative;display: inline-block;margin:5px;">
				<span>司机名称:</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入司机名称"
					v-model="driverNameT">
				</el-input>&nbsp;&nbsp;
			</div>
			<div style="position: relative;display: inline-block;margin:5px;">
				<span>手机号:</span>
				<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入手机号"
					v-model="riderPhone">
				</el-input>&nbsp;&nbsp;
			</div>
			<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="select">查询
			</el-button>
			<el-button style="margin:10px;" size="mini" type="primary" icon="document" @click="cleans">重置
			</el-button>&nbsp;&nbsp;
			<el-button style='margin-left:15px;' size="mini" type="primary" :disabled="!isAuth('DriverItinerary:add')" icon="document" @click="addBtn()">添加
			</el-button>
		</div>
		<el-table v-loading="tableDataLoading" :data="homeData.list">
			<el-table-column fixed prop="driverRouteId" label="编号" width="80">
			</el-table-column>
			<el-table-column prop="userName" label="用户昵称" >
				<template slot-scope="scope">
					<div style="color: #4f9dec;cursor: pointer;"  @click="updatesvideo(scope.row.userId)">
						{{scope.row.userName}}
					</div>
				</template>
			</el-table-column>
			<el-table-column prop="driverName" label="司机名称" width="120">
				<template slot-scope="scope">
					　<span
						v-text="scope.row.driverName"></span>
				</template>
			</el-table-column>
			<el-table-column prop="phone" label="手机号"width="160">
			</el-table-column>
			<el-table-column prop="deilveryAddressDetail" label="出发地址" width="200">
				<template slot-scope="scope">
					<div>
						{{scope.row.shipProvince}}{{scope.row.shipCity}}{{scope.row.shipDistrict}}{{scope.row.shipAddress}}
					</div>
					<div>目的经纬度：{{scope.row.shipAddressLatitude}} / {{scope.row.shipAddressLongitude}}</div>
				</template>
			</el-table-column>
			<el-table-column prop="deilveryAddressDetail" label="目的地址"  width="200">
				<template slot-scope="scope">
					<div>
						{{scope.row.deliveryProvince}}{{scope.row.deliveryCity}}{{scope.row.deliveryDistrict}}{{scope.row.deliveryAddress}}
					</div>
					<div>目的经纬度：{{scope.row.deliveryAddressLatitude}} / {{scope.row.deliveryAddressLongitude}}</div>
				</template>
			</el-table-column>
			<!-- <el-table-column prop="messageCount" label="是否邀请过车主">
				<template slot-scope="scope">
					<div v-if="scope.row.messageCount==1">是</div>
					<div v-else>否</div>
				</template>
			</el-table-column> -->
			<el-table-column prop="seatNum" label="可提供的座位数">
			</el-table-column>
			<el-table-column prop="isFriends" label="是否有亲友同行">
				<template slot-scope="scope">
					<div v-if="scope.row.isFriends==1">是</div>
					<div v-else>否</div>
				</template>
			</el-table-column>
			<el-table-column prop="startTime" label="预约时间" width="160">
			</el-table-column>
			<el-table-column prop="createTime" label="创建时间" width="160">
			</el-table-column>
			<el-table-column prop="isHighSpeedPrice" label="是否承担高速费用" fixed="right" width="80">
				<template slot-scope="scope">
					<div v-if="scope.row.isHighSpeedPrice==1">司机承担</div>
					<div v-if="scope.row.isHighSpeedPrice==2">乘客承担</div>
					<div v-if="scope.row.isHighSpeedPrice==3">费用AA</div>
				</template>
			</el-table-column>
			<el-table-column label="操作" width="120" fixed='right'>
				<template slot-scope="scope">
					<el-button style='margin:5px;' size="mini" :disabled="!isAuth('DriverItinerary:update')" type="primary" icon="document" @click="addBtn(scope.row)">修改
					</el-button>
					<el-button size="mini" type="warning"
						:disabled="!isAuth('DriverItinerary:delete')" @click="wanchengOr(scope.row)"
						style="margin: 5px;">删除</el-button>
				</template>
			</el-table-column>
		</el-table>
		<div style="text-align: center;margin-top: 10px;float:right">
			<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
				:page-sizes="[10, 20, 30, 40]" :page-size="size" :current-page="page"
				layout="total,sizes, prev, pager, next,jumper" :total="homeData.totalCount">
			</el-pagination>
		</div>
		<!-- 师傅列表 -->
		<el-dialog title="师傅列表" :visible.sync="dialogFormVisible" center width="70%">
			<div style="margin:2% 0;display: inline-block;">
				<span>手机号:</span>
				<el-input style="width: 150px;" @keydown.enter.native="selectU" clearable placeholder="请输入手机号"
					v-model="phoneU"></el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span>昵称:</span>
				<el-input style="width: 150px;" @keydown.enter.native="selectU" clearable placeholder="请输入昵称"
					v-model="campus"></el-input>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="selectU">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleansU">重置
				</el-button>
			</div>
			<el-table v-loading="tableDataLoadingU" :data="userData.records">
				<el-table-column prop="userId" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="nickName" label="用户昵称" width="120">
					<template slot-scope="scope">
						　<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row.userId)"
							v-text="scope.row.nickName"></span>
					</template>
				</el-table-column>
				<el-table-column prop="avatar" label="用户头像" width="100">
					<template slot-scope="scope">
						　　<img v-if="scope.row.avatar && scope.row.avatar!=''" :src="scope.row.avatar" width="40"
							height="40" />
						<span v-else>暂无图片</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号">
				</el-table-column>
				<el-table-column prop="createTime" label="创建时间" width="180">
				</el-table-column>
				<el-table-column label="操作" prop="id" width="100" fixed='right' align="center">
					<template slot-scope="scope">
						<!-- <el-button size="mini" v-if="adds==1" type="primary" @click="userBtns(scope.row)">确认
						</el-button> -->
						<el-button size="mini" v-if="adds==2" type="primary" @click="userBtns2(scope.row)">确认
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeU" @current-change="handleCurrentChangeU"
					:page-sizes="[10, 20, 30, 40]" :page-size="limit1" :current-page="page1"
					layout="total,sizes, prev, pager, next,jumper" :total="userData.total">
				</el-pagination>
			</div>
		</el-dialog>
		<!-- 修改备注时间 -->
		<el-dialog title="修改备注时间" :visible.sync="dialogFormVisibleBz" center>
			<div style="margin-bottom: 10px;">
				<span
					style="width: 200px;display: inline-block;text-align: right;position: relative;top: -70px;">备注：</span>
				<el-input style="width:50%;" v-model="content" type="textarea" :rows="4" placeholder="请输入备注">
				</el-input>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleBz = false">取 消</el-button>
				<el-button type="primary" @click="replyNoticeTo()">确 定</el-button>
			</div>
		</el-dialog>
		<!-- 加时记录 -->
		<el-dialog title="加时记录" :visible.sync="dialogFormVisibleJs" center width="80%">
			<div style="text-align: right;margin-right: 36px;">
				<el-button size="mini" type="primary" @click="jaishiAdd()">添加
				</el-button>
			</div>
			<el-table v-loading="tableDataLoadingU" :data="userDataJl.records">
				<el-table-column prop="recordId" label="编号" width="80">
				</el-table-column>
				<el-table-column prop="time" label="分钟数">
				</el-table-column>
				<el-table-column prop="createTime" label="创建时间">
				</el-table-column>
				<el-table-column label="操作" prop="id" width="100">
					<template slot-scope="scope">
						<el-button size="mini" type="danger" @click="jaishiDel(scope.row)">删除
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChangeJl" @current-change="handleCurrentChangeJl"
					:page-sizes="[10, 20, 30, 40]" :page-size="limit1" :current-page="page1"
					layout="total,sizes, prev, pager, next,jumper" :total="userDataJl.total">
				</el-pagination>
			</div>
		</el-dialog>
		<!-- 加时记录 -->
		<!-- <el-dialog title="加时" :visible.sync="dialogFormVisibleJsAdd" center>
			<div>
				<span style="width: 200px;display: inline-block;text-align: right;">加时类型：</span>
				<el-radio-group v-model="timeId">
					<el-radio v-for="(item,index) in dataList" :key="index" :label="item.timeId">
						时长：{{item.money}}/{{item.timeNum}}
						<span v-if="item.timeUnit==1">分钟</span>
						<span v-if="item.timeUnit==2">小时</span>
						<span v-if="item.timeUnit==3">天</span>
					</el-radio>
				</el-radio-group>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleJsAdd = false">取 消</el-button>
				<el-button type="primary" @click="changeSh()">确 定</el-button>
			</div>
		</el-dialog> -->
		<!-- 添加/修改 弹框 -->
		<el-dialog :title="titles" :visible.sync="dialogFormVisibleJsAdd" center width="80%">
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">选择用户：</span>
				<el-input style="width:50%;" v-model="userName" @focus="userBtn" type="text" placeholder="请选择用户">
				</el-input>
			</div>
			<!-- <div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">顺路百分比：</span>
				<el-input style="width:50%;" v-model="similarity" type="number" :min="0" placeholder="请输入顺路百分比,例:0.8">
				</el-input>
			</div> -->
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">预约时间：</span>
				<!-- <el-input style="width:50%;" v-model="startTime" type="text" placeholder="请输入预约时间">
				</el-input> -->
				<el-date-picker style="width: 50%;" v-model="startTime" align="right"
					type="datetime" format="MM月dd日 HH:mm" value-format="MM月dd日 HH:mm" placeholder="选择时间">
				</el-date-picker>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">可提供的座位数：</span>
				<el-radio-group v-model="seatNum">
					<el-radio :label="1">1座</el-radio>
					<el-radio :label="2">2座</el-radio>
					<el-radio :label="3">3座</el-radio>
					<el-radio :label="4">4座</el-radio>
				</el-radio-group>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">是否有亲友同行：</span>
				<el-radio-group v-model="isFriends">
					<el-radio :label="1">是</el-radio>
					<el-radio :label="2">否</el-radio>
				</el-radio-group>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">是否承担高速费：</span>
				<el-radio-group v-model="isHighSpeedPrice">
					<el-radio :label="1">司机承担</el-radio>
					<el-radio :label="2">乘客承担</el-radio>
					<el-radio :label="3">费用AA</el-radio>
				</el-radio-group>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">出发地址：</span>
				<el-button type="primary" @click="huoqudizhi(1)" plain>获取出发地址</el-button>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">出发省市区：</span>
				<el-cascader style="width:200px" size="large" :options="options" ref="cascaderAddr"
					v-model="storeAddressc" :placeholder="storeAddrec" disabled :value="storeAddrec">
				</el-cascader> <!-- @change="handleChange5" -->
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">出发详细地址：</span>
				<el-input style="width:50%;" v-model="shipAddress" type="text" disabled placeholder="请输入出发详细地址">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">出发地址经度：</span>
				<el-input style="width:50%;" v-model="shipAddressLongitude" disabled type="text" placeholder="请选择出发地址经度">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">出发地址纬度：</span>
				<el-input style="width:50%;" v-model="shipAddressLatitude" disabled type="text" placeholder="请选择出发地址纬度">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">目的地地址：</span>
				<el-button type="primary" @click="huoqudizhi(2)" plain>获取目的地地址</el-button>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">目的地省市区：</span>
				<el-cascader style="width:200px" size="large" :options="options" disabled ref="cascaderAddr2"
					v-model="storeAddressm" :placeholder="storeAddrem" :value="storeAddrem">
				</el-cascader>  <!-- @change="handleChange55" -->
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">目的地详细地址：</span>
				<el-input style="width:50%;" v-model="deliveryAddress" type="text" disabled placeholder="请输入目的地详细地址">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">目的地经度：</span>
				<el-input style="width:50%;" v-model="deliveryAddressLongitude" disabled type="text" placeholder="请选择目的地经度">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">目的地纬度：</span>
				<el-input style="width:50%;" v-model="deliveryAddressLatitude" disabled type="text" placeholder="请选择目的地纬度">
				</el-input>
			</div>
			

			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleJsAdd = false">取 消</el-button>
				<el-button type="primary" @click="changeShAdd()">确 定</el-button>
			</div>
		</el-dialog>
		<!-- 地图 -->
		<el-dialog title="地图定位" :visible.sync="dialogFormVisibleDt" center width="70%">
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">省市区：</span>
				<el-cascader style="width:50%" size="large" :options="options" ref="cascaderAddr3"
					v-model="storeAddress" :placeholder="storeAddre" @change="handleChange6" :value="storeAddre">
				</el-cascader>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">详细地址：</span>
				<el-input style="width:50%;" v-model="address" type="text" @keydown.enter.native="selectDt" placeholder="请输入目的地详细地址">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">经度：</span>
				<el-input style="width:50%;" v-model="longitude" type="text" placeholder="请选择经度">
				</el-input>
			</div>
			<div style="margin-bottom: 10px;">
				<span style="width: 200px;display: inline-block;text-align: right;">纬度：</span>
				<el-input style="width:50%;" v-model="latitude" type="text" placeholder="请选择纬度">
				</el-input>
			</div>
			<div>
				<div id="container1" style="width:80%;height:500px;margin-left: 10%;"></div>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleDt = false">取 消</el-button>
				<el-button type="primary" @click="changeDt()">确定选择</el-button>
			</div>
		</el-dialog>
	</div>
</template>

<script>
	import {
		quillEditor
	} from 'vue-quill-editor'
	import 'quill/dist/quill.core.css'
	import 'quill/dist/quill.snow.css'
	import 'quill/dist/quill.bubble.css'
	import quillConfig from '../locality/quill-config.js'
	import axios from 'axios';
	import {
		jsonp
	} from 'vue-jsonp'
	import {
		provinceAndCityData,
		regionData,
		provinceAndCityDataPlus,
		regionDataPlus,
		CodeToText,
		TextToCode
	} from 'element-china-area-data'
	var cityOptions = []
	var geocoder, map, markersArray, infoWindow = [];
	export default {
		components: {
			quillEditor,
		},
		data() {
			return {
				
				size: 10,
				page: 1,
				state: '',
				limit: 10,
				title: '',
				type: '',
				method: 'false',
				tableDataLoading: true,
				tableDataLoading4: false,
				dialogFormVisible3: false,
				homeData: [],
				homeData1: [{
						title: '全部',
						id: ''
					}, {
						title: '即时代驾',
						id: 1
					},
					{
						title: '朋友代叫',
						id: 2
					},
					{
						title: '预约代驾',
						id: 3
					},
				],
				url: '',
				imageUrl: '',
				id: '',
				formcomp: {
					id: '',
					state: '',
					title: '',
					url: '',
					imageUrl: ''
				},
				userId: '',
				classifyIds: 0,
				// 房屋信息
				phone: '', //电话
				img: [], //详情图
				status: '', //状态0待审核  1上架  2下架 3驳回 (修改添加不传)
				options: regionData,
				storeAddress: [],
				storeAddressm: [],
				storeAddressc: [],
				storeAddre: '请选择城市',
				storeAddrem: '请选择城市',
				storeAddrec: '请选择城市',
				province: '', //省
				city: '', //市
				district: '', //区
				ids: '', //信息id
				nickName: '',
				userIds: {}, //用户列表
				campus: '',
				///   0待接单 1已接单 2进行中 3待支付 4已完成 5已取消
				statesnum1: [{
						value: '',
						label: '全部'
					},

					{
						value: 1,
						label: '司机承担'
					}, {
						value: 2,
						label: '乘客承担'
					}, {
						value: 3,
						label: '费用AA'
					},
				],
				// x新的
				indentType: '', //跑腿类型
				deliveryUserPhone: '', //收货人手机号
				indentState: '', //任务状态
				flag: '',
				info: {
					stockDate: this.getNowTime(), //日期
				},
				flags: [{
					value: 'day',
					label: '按天查询'
				}, {
					value: 'month',
					label: '按月查询'
				}, {
					value: 'year',
					label: '按年查询'
				}],
				// 指派
				userData: {},
				phoneU: '',
				campus: '',
				ordersId: '',
				limit1: 10,
				page1: 1,
				dialogFormVisible: false,
				tableDataLoadingU: false,
				laundryIdU: '',
				// 添加/修改任务
				titles: '',
				buyType: '',
				deilveryAddressDetail: '', //收货详细地址
				deliveryAddress: '', //收货大概地址
				deliveryAddressA: '', //展示
				deliveryAddressLatitude: '', //收货地址纬度
				deliveryAddressLongitude: '', //收货地址经度
				deliveryUserPhone: '', //收货人电话
				shipUserName: '', //发货人姓名
				shipUserPhone: '', //发货人电话
				shipAddress: '', //指定大概地址
				shipAddressA: '', //展示地址
				shipAddressLatitude: '', //指定地址纬度
				shipAddressLongitude: '', //指定地址经度
				nickNameRw: '',
				userIdRw: '',
				remarks: '', //备注
				address: '', //地址
				latitude: '', //纬度
				longitude: '', //经度
				wupin: [], //物品分类
				phoneT: '',
				riderNickName: '',
				driverName:'',
				riderPhone: '',
				indentNumber: '',
				shipUserPhone: '',
				customPhone: '',
				totalMoney: 0,
				dialogFormVisibleDt: false,
				map: '',
				typeIndex: '',
				dialogFormVisibleBz: false,
				ordersId: '',
				content: '',
				parentId: '',
				citys: [],
				citys2: [],
				cityId: '',
				dialogFormVisibleJs: false,
				userDataJl: {},
				moneyType: '', //价格计算方式 1包时订单 2按时长收费
				addType: '', //下单类型 1:用户下单 2:司机下单
				statesnum2: [{
						value: '',
						label: '全部'
					},
					{
						value: 1,
						label: '用户下单'
					}, {
						value: 2,
						label: '司机下单'
					},
				],
				statesnum3: [{
						value: '',
						label: '全部'
					},
					{
						value: 1,
						label: '包时订单'
					}, {
						value: 2,
						label: '按时长收费'
					},
				],
				dataList: [],
				dialogFormVisibleJsAdd: false,
				timeId: '',
				// -----
				driverRouteId: 1, //id
				userId: 1, //用户id
				driverId: 1, //司机id
				shipProvince: "", //出发省
				shipCity: "", //出发市
				shipDistrict: "", //出发区
				shipAddress: "", //出发地址
				shipAddressLongitude: "", //出发地址经度
				shipAddressLatitude: "", //出发地址维度
				deliveryProvince: "", //目的省
				deliveryCity: "", //目的市
				deliveryDistrict: "", //目的区
				deliveryAddress: "", //目的地址
				deliveryAddressLongitude: "", //目的地址经度
				deliveryAddressLatitude: "", //目的地址维度
				status: 1, //状态 1正常 2关闭
				createTime: "", //创建时间
				similarity: 1, //顺路百分比
				driverPlate: "", //车辆品牌
				ordersCount: 1, //接单数量
				messageCount: 1, //是否邀请过车主 1是
				dituTypes:1,
				adds:1,
				userName:'',
				startTime:'',
				seatNum:'',
				isFriends:'',
				driverNameT:'',
				isHighSpeedPrice:'',
			}
		},
		methods: {
			//处理默认选中当前日期
			getNowTime() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() //得到月份
				var date = now.getDate() //得到日期
				var hh = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()
				var mm = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()
				var ss = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			handleAvatarSuccess3(file) {
				this.formcomp.imageUrl = file.data
			},
			handleAvatarSuccess4(file) {
				this.imageUrl = file.data
			},

			handleSizeChange1(val) {
				this.limit = val
				this.homeSelect()
			},
			handleCurrentChange1(val) {
				this.page = val
				this.homeSelect()
			},
			handleSizeChange2(val) {
				this.limit = val
				this.homeSelect()
			},
			handleCurrentChange2(val) {
				this.page = val
				this.homeSelect()
			},
			handleSizeChangeU(val) {
				this.limit1 = val;
				this.dataSelectUser()
			},
			handleCurrentChangeU(val) {
				this.page1 = val;
				this.dataSelectUser()
			},
			handleSizeChangeUser(val) {
				this.limit1 = val
				this.userClass()
			},
			handleCurrentChangeUser(val) {
				this.page1 = val
				this.userClass()
			},
			handleClick(tab, event) {
				this.page = 1
				this.indentState = ''
				this.phoneT = ''

				// if (tab._props.label == '同城帮买') {
				//   this.indentType = 3
				//   this.homeSelect()
				// }
				// if (tab._props.label == '同城服务') {
				//   this.type = 1
				//   this.indentType = 4
				//   this.homeSelect()
				// }
				if (tab._props.label == '送取任务') {
					this.indentType = 1
					this.homeSelect()
				}
			},
			// 师傅取消订单
			compile(index, rows) {
				this.$confirm(`确定师傅要取消订单吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning',
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('adminerrand/riderCancelIndent'),
						method: 'post',
						params: this.$http.adornParams({
							'userId': rows.riderUserId,
							'indentId': rows.indentId,
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.homeSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
					})
				}).catch(() => {})
				// }).then((res) => {

				// }).catch(() => {
				// 	console.log('取消')
				// })
			},

			// 获取数据列表
			homeSelect() {
				this.totalMoney = 0
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl('driverRoute/selectDriverRouteList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page,
						'limit': this.limit,
						'userName': this.riderNickName,
						'phone': this.riderPhone,
						'shipProvince': '',
						'shipCity': this.cityId,
						'shipDistrict': '',
						'shipAddress': '',
						'deliveryProvince': '',
						'deliveryCity': this.customPhone,
						'deliveryDistrict': '',
						'deliveryAddress': '',
						'driverName':this.driverNameT,
						'isHighSpeedPrice':this.indentState

					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.homeData = data.data
				})
			},
			// 筛选信息
			animeDat2(classifyIds) {
				this.classifyIds = classifyIds
				this.homeSelect()
			},

			// 详情跳转
			updatesvideo(userId) {
				if (userId) {
					this.$router.push({
						path: '/userDetail',
						query: {
							userId: userId
						}
					})
				}

			},
			// 查询
			select() {
				this.page = 1
				this.limit = 10
				this.homeSelect()
			},
			// 重置
			cleans() {
				this.page = 1
				this.indentState = ''
				this.phoneT = ''
				this.riderNickName = ''
				this.driverNameT = ''
				this.riderPhone = ''
				this.shipUserPhone = ''
				this.flag = ''
				this.customPhone = ''
				this.indentNumber = ''
				this.cityId = ''
				this.parentId = ''
				this.moneyType = ''
				this.addType = ''
				this.indentType = ''
				this.info.stockDate = this.getNowTime()
				this.homeSelect()
			},
			// 订单分析选择日期
			animeOrder() {
				console.log('info', this.info)
				this.homeSelect()
				// this.colonel()
			},
			// 订单分析年月日
			orderfenxi(value) {
				this.page = 1
				let vanumber = value
				// if (vanumber === 1) {
				this.flag = value
				this.homeSelect()
				// this.colonel()
				// }
				// if (vanumber === 2) {
				// 	this.flag = 2
				// 	this.taskData()
				// 	this.colonel()
				// }
				// if (vanumber === 3) {
				// 	this.flag = 3
				// 	this.taskData()
				// 	this.colonel()
				// }
			},
			// 开始服务
			zhuandan(row) {
				this.$http({
					url: this.$http.adornUrl('adminerrand/riderStartDrive'),
					method: 'post',
					params: this.$http.adornParams({
						'userId': row.riderUserId,
						'indentId': row.indentId,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.homeSelect()
								// this.dialogFormVisible = false
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}


				})



			},

			// 师傅完成
			wancheng(row) {
				this.$http({
					url: this.$http.adornUrl('adminerrand/riderDelivery'),
					method: 'post',
					params: this.$http.adornParams({
						'userId': row.riderUserId,
						'indentId': row.indentId,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.homeSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
				})
			},
			// 派单弹框
			paidan(row, index) {
				this.typeIndex = index
				this.driverRouteId = row.driverRouteId
				this.page1 = 1
				this.campus = ''
				this.phoneU = ''
				this.laundryIdU = ''
				this.adds = 1
				this.dataSelectUser()
				this.dialogFormVisible = true
			},
			// 确认选择
			userBtns(row) {
					var url = 'driverRoute/insertMessageByDriver'
				this.$http({
					url: this.$http.adornUrl(url),
					method: 'post',
					params: this.$http.adornParams({
						'ordersId':this.ordersId,
						'driverRouteId':this.driverRouteId,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.homeSelect()
								this.dialogFormVisible = false
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}


				})
			},
			// 获取数据列表
			dataSelectUser() {
				this.tableDataLoadingU = true
				this.$http({
					url: this.$http.adornUrl('user/getRiderList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page1,
						'limit': this.limit1,
						// 'member': this.member,
						'phone': this.phoneU,
						'nickName': this.campus,
						// 'userType': 2,
						// 'invitationCode': '',
						// 'platform': '',
						// 'onLineFlag':1,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoadingU = false
					let returnData = data.data
					this.userData = returnData
				})
			},
			// 查询
			selectU() {
				this.page = 1
				this.dataSelectUser()
			},
			// 重置
			cleansU() {
				this.page1 = 1
				this.campus = ''
				this.phoneU = ''
				this.laundryIdU = ''
				this.dataSelectUser()
			},


			// 获取用户列表弹框
			userselect() {
				this.page1 = 1
				this.phone = ''
				this.nickName = ''
				this.dialogFormVisible3 = true
				this.userClass()
			},
			// 获取用户列表
			userClass() {
				let phone = ''
				if (this.phone) {
					phone = this.phone
				}
				let nickName = ''
				if (this.nickName) {
					nickName = this.nickName
				}
				this.tableDataLoading4 = true
				this.$http({
					url: this.$http.adornUrl('adminerrand/findAllUser'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page1,
						'limit': this.limit1,
						// 'member': this.member,
						'phone': phone,
						'nickName': nickName,
						'userType': 1,
						'invitationCode': '',
						'platform': ''
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading4 = false
					let returnData = data.data
					this.userIds = returnData
				})
			},
			// 查询用户列表
			userclick() {
				this.page1 = 1
				this.tableDataLoading4 = true
				this.userClass()
			},
			// 重置用户列表数据
			userclose() {
				this.page1 = 1
				this.phone = ''
				this.nickName = ''
				this.tableDataLoading4 = true

				this.userClass()
			},
			// 确定用户
			confirm(row) {
				this.userIdRw = row.userId
				this.nickNameRw = row.nickName
				// this.phone = row.phone
				if (this.nickNameRw == '' || this.nickNameRw == null) {
					this.nickNameRw = row.phone
				}
				this.dialogFormVisible3 = false
			},
			buyTypeBtn() {
				if (this.buyType == 0) {
					this.deliveryAddressA = '师傅将在您附近3公里内购买'
					this.shipAddress = ''
					this.shipAddressA = ''
				} else {
					this.deliveryAddressA = ''
					this.shipAddress = ''
					this.shipUserName = ''
					this.shipUserPhone = ''
					this.shipAddressA = ''
				}
			},
			
			// 获取物品类型获取物品类型
			xianshi() {
				this.$http({
					url: this.$http.adornUrl('common/type/334'),
					method: 'get',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						//this.wupin = data.data.value.split(',')
						this.wupin = data.data
					}
				})
			},
			// 线路规划弹框
			dituguihua(row) {
				var item = JSON.stringify(row)
				this.$router.push({
					path: '/dituguihua',
					query: {
						item: item
					}
				})

			},
			initMap() {
				var center = new TMap.LatLng(39.984104, 116.307503);
				//初始化地图
				var map = new TMap.Map("container", {
					rotation: 20, //设置地图旋转角度
					pitch: 30, //设置俯仰角度（0~45）
					zoom: 12, //设置地图缩放级别
					center: center //设置地图中心点坐标
				});
			},
			displayPolyline(pl) {
				// 创建 MultiPolyline显示路径折线
				var polylineLayer = new TMap.MultiPolyline({
					id: 'polyline-layer',
					map: map,
					styles: {
						style_blue: new TMap.PolylineStyle({
							color: '#3777FF',
							width: 8,
							borderWidth: 5,
							borderColor: '#FFF',
							lineCap: 'round',
						}),
					},
					geometries: [{
						id: 'pl_1',
						styleId: 'style_blue',
						paths: pl,
					}, ],
				});
			},
			// 修改备注、时间
			updateBz(row) {

				this.content = row.remarks
				this.ordersId = row.indentId
				this.dialogFormVisibleBz = true
			},
			// 修改
			replyNoticeTo() {
				if (this.content == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入备注',
						type: 'warning'
					});
					return
				}
				if (this.content.length > 100) {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '备注信息最多输入100字',
						type: 'warning'
					});
					return
				}
				this.$http({
					url: this.$http.adornUrl('indent/updateIndent'),
					method: 'post',
					// params: this.$http.adornParams({
					data: this.$http.adornData({
						'indentId': this.ordersId,
						'remarks': this.content,
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.homeSelect()
							}
						})
						this.dialogFormVisibleBz = false
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}

				})
			},
			
			// 加时记录
			jiashiBtn(row) {
				this.page1 = 1
				this.cityId = row.cityId
				this.ordersId = row.indentId
				this.dataSelectJs()
				this.dialogFormVisibleJs = true
			},
			dataSelectJs() {
				this.tableDataLoadingU = true
				this.$http({
					url: this.$http.adornUrl('admin/indentTimeRecord/getIndentTimeRecordList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': this.page1,
						'limit': this.limit1,
						'indentId': this.ordersId,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoadingU = false
					let returnData = data.data
					this.userDataJl = returnData
				})
			},
			handleSizeChangeJl(val) {
				this.limit1 = val;
				this.dataSelectJs()
			},
			handleCurrentChangeJl(val) {
				this.page1 = val;
				this.dataSelectJs()
			},
			// 添加加时
			jaishiAdd() {
				this.$http({
					url: this.$http.adornUrl('admin/packageTime/getPackageTimeList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': 1,
						'limit': 30,
						'cityId': this.cityId,
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.dataList = returnData.records
				})
				this.timeId = ''
				this.dialogFormVisibleJsAdd = true
			},
			// 确认添加
			changeSh() {
				this.$http({
					url: this.$http.adornUrl('admin/indentTimeRecord/indentAddTime'),
					method: 'post',
					params: this.$http.adornParams({
						// data: this.$http.adornData({
						'indentId': this.ordersId,
						'timeId': this.timeId,

					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.dialogFormVisibleJsAdd = false
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelectJs()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}

				})
			},
			// 删除加时
			jaishiDel(row) {
				let delid = row.recordId
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: ''
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('admin/indentTimeRecord/indentRemoveTime'),
						method: 'get',
						params: this.$http.adornParams({
							'recordId': delid
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '删除成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelectJs()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},
			// 完成订单
			wanchengOr(row) {
				this.$confirm(`确定删除信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: ''
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl('driverRoute/deleteDriverRoute'),
						method: 'post',
						params: this.$http.adornParams({
							'driverRouteId': row.driverRouteId,
						})
					}).then(({
						data
					}) => {
						if (data.code == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.homeSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}
					})

				}).catch(() => {})


			},
			// 添加/修改 弹框
			addBtn(row) {
				if (row) {
					this.titles = '修改'
					this.driverRouteId = row.driverRouteId
					this.userName = row.userName
					this.userId = row.userId
					this.driverId = row.driverId
					this.shipProvince = row.shipProvince
					this.shipCity = row.shipCity
					this.shipDistrict = row.shipDistrict
					this.shipAddress = row.shipAddress
					this.shipAddressLongitude = row.shipAddressLongitude
					this.shipAddressLatitude = row.shipAddressLatitude
					this.deliveryProvince = row.deliveryProvince
					this.deliveryCity = row.deliveryCity
					this.deliveryDistrict = row.deliveryDistrict
					this.deliveryAddress = row.deliveryAddress
					this.deliveryAddressLongitude = row.deliveryAddressLongitude
					this.deliveryAddressLatitude = row.deliveryAddressLatitude
					this.status = row.status
					this.similarity = row.similarity
					this.driverPlate = row.driverPlate
					if(row.startTime){
						this.startTime = row.startTime
					}else{
						this.startTime = ''
					}
					if(row.seatNum){
						this.seatNum = Number(row.seatNum)
					}else{
						this.seatNum = ''
					}
					if(row.isFriends){
						this.isFriends = Number(row.isFriends)
					}else{
						this.isFriends = ''
					}
					if(row.isHighSpeedPrice){
						this.isHighSpeedPrice = Number(row.isHighSpeedPrice)
					}else{
						this.isHighSpeedPrice = ''
					}
					
					
					this.ordersCount = row.ordersCount
					if(row.messageCount){
						this.messageCount = row.messageCount
					}else{
						this.messageCount = 2
					}
					this.storeAddrec = this.shipProvince+'/'+this.shipCity+'/'+this.shipDistrict
					this.storeAddrem = this.deliveryProvince+'/'+this.deliveryCity+'/'+this.deliveryDistrict
				} else {
					this.titles = '添加'
					this.driverRouteId = ''
					this.userName = ''
					this.userId = ''
					this.driverId = ''
					this.startTime = ''
					this.shipProvince = ''
					this.shipCity = ''
					this.shipDistrict = ''
					this.shipAddress = ''
					this.shipAddressLongitude = ''
					this.shipAddressLatitude = ''
					this.deliveryProvince = ''
					this.deliveryCity = ''
					this.deliveryDistrict = ''
					this.deliveryAddress = ''
					this.deliveryAddressLongitude = ''
					this.deliveryAddressLatitude = ''
					this.status = 1
					this.similarity = ''
					this.driverPlate = ''
					this.ordersCount = ''
					this.seatNum = ''
					this.isFriends = ''
					this.isHighSpeedPrice = ''
					
					this.messageCount = 2
					this.storeAddrec = '请选择城市'
					this.storeAddrem = '请选择城市'
				}
				this.dialogFormVisibleJsAdd = true
			},
			// 打开地图弹框
			huoqudizhi(index){
				this.dituTypes = index
				if(index==1){
					
					this.province = this.shipProvince
					this.city = this.shipCity
					this.district = this.shipDistrict
					this.address = this.shipAddress
					this.longitude = this.shipAddressLongitude
					this.latitude = this.shipAddressLatitude
					this.storeAddre = '请选择城市'
					this.storeAddress = [this.shipProvince,this.shipCity,this.shipDistrict]
					
				}else{
					
					this.province = this.deliveryProvince
					this.city = this.deliveryCity
					this.district = this.deliveryDistrict
					this.address = this.deliveryAddress
					this.longitude = this.deliveryAddressLongitude
					this.latitude = this.deliveryAddressLatitude
					this.storeAddre = '请选择城市'
					this.storeAddress = [this.deliveryProvince,this.deliveryCity,this.deliveryDistrict]
				}
				this.getMyLocation()
				this.dialogFormVisibleDt = true
			},
			changeDt(){
				if(this.dituTypes==1){
					this.shipProvince = this.province
					this.shipCity = this.city 
					this.shipDistrict = this.district
					this.shipAddress = this.address
					this.shipAddressLongitude = this.longitude
					this.shipAddressLatitude = this.latitude
					this.storeAddrec = this.shipProvince+'/'+this.shipCity+'/'+this.shipDistrict
					this.storeAddressc = []
					
				}else{
					this.deliveryProvince = this.province
					this.deliveryCity = this.city
					this.deliveryDistrict = this.district
					this.deliveryAddress = this.address
					this.deliveryAddressLongitude = this.longitude
					this.deliveryAddressLatitude = this.latitude
					this.storeAddrem = this.deliveryProvince+'/'+this.deliveryCity+'/'+this.deliveryDistrict
					this.storeAddressm = []
				}
				this.dialogFormVisibleDt = false
			},
			// 确认添加
			changeShAdd() {
				
				
				
				if (this.userId === ''||this.userId ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '用户不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.startTime === ''||this.startTime ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '预约时间不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.seatNum === ''||this.seatNum ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '可提供的座位数不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.isFriends === ''||this.isFriends ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '是否有亲友同行不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.isHighSpeedPrice === ''||this.isHighSpeedPrice ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '是否承担高速费不能为空',
				        type: 'warning'
				    });
				    return
				}
				
				
				if (this.shipCity === ''||this.shipCity ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '出发地省市区不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.shipAddress === ''||this.shipAddress ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '出发地址不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.shipAddressLongitude === ''||this.shipAddressLatitude ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '出发地经纬度不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.deliveryCity === ''||this.deliveryCity ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '目的地省市区不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.deliveryAddress === ''||this.deliveryAddress ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '目的地地址不能为空',
				        type: 'warning'
				    });
				    return
				}
				if (this.deliveryAddressLongitude === ''||this.deliveryAddressLatitude ==null) {
				    this.$notify({
				        title: '提示',
				        duration: 1800,
				        message: '目的地经纬度不能为空',
				        type: 'warning'
				    });
				    return
				}
				
				if(this.titles == '添加'){
					var url = 'driverRoute/insertDriverRoute'
				}else{
					var url = 'driverRoute/updateDriverRoute'
				}
				this.$http({
					url: this.$http.adornUrl(url),
					method: 'post',
					// params: this.$http.adornParams({
						data: this.$http.adornData({
						'driverRouteId': this.driverRouteId,
						'userId': this.userId,
						'driverId': this.driverId,
						'shipProvince': this.shipProvince,
						'shipCity': this.shipCity,
						'shipDistrict': this.shipDistrict,
						'shipAddress': this.shipAddress,
						'shipAddressLongitude': this.shipAddressLongitude,
						'shipAddressLatitude': this.shipAddressLatitude,
						'deliveryProvince': this.deliveryProvince,
						'deliveryCity': this.deliveryCity,
						'deliveryDistrict': this.deliveryDistrict,
						'deliveryAddress': this.deliveryAddress,
						'deliveryAddressLongitude': this.deliveryAddressLongitude,
						'deliveryAddressLatitude': this.deliveryAddressLatitude,
						'status': this.status,
						'similarity': this.similarity,
						'driverPlate': this.driverPlate,
						'ordersCount': this.ordersCount,
						'messageCount': this.messageCount,
						'startTime':this.startTime,
						'seatNum':this.seatNum,
						'isFriends':this.isFriends,
						'isHighSpeedPrice':this.isHighSpeedPrice,
			
					})
				}).then(({
					data
				}) => {
					if (data.code == 0) {
						this.dialogFormVisibleJsAdd = false
						this.$message({
							message: '操作成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.homeSelect()
							}
						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
			
				})
			},
			// 获取省市区
			handleChange5(value) {
				value = this.$refs['cascaderAddr'].currentLabels
				this.shipProvince = value[0]
				this.shipCity = value[1]
				this.shipDistrict = value[2]
				if (this.shipCity == '市辖区') {
					this.shipCity = this.shipProvince
				}
				console.log(this.$refs['cascaderAddr'].currentLabels)
			},
			// 获取省市区
			handleChange55(value) {
				value = this.$refs['cascaderAddr2'].currentLabels
				this.deliveryProvince = value[0]
				this.deliveryCity = value[1]
				this.deliveryDistrict = value[2]

				if (this.deliveryCity == '市辖区') {
					this.deliveryCity = this.deliveryProvince
				}

				console.log(this.$refs['cascaderAddr2'].currentLabels)
			},
			// 获取省市区
			handleChange6(value) {
				value = this.$refs['cascaderAddr3'].currentLabels
				this.province = value[0]
				this.city = value[1]
				this.district = value[2]
				if (this.city == '市辖区') {
					this.city = this.province
				}
				console.log(this.$refs['cascaderAddr3'].currentLabels)
			},
			//定位获得当前位置信息
			getMyLocation() {
				var geolocation = new qq.maps.Geolocation("SZWBZ-QDWC3-M233R-YDXW5-TZT7Q-S4FJ7", "代驾管理管理");
				geolocation.getIpLocation(this.showPosition, this.showErr);
				// geolocation.getLocation(this.showPosition, this.showErr);//或者用getLocation精确度比较高
			},
			showPosition(position) {
				console.log(position);
				// this.latitude = position.lat;
				// this.longitude = position.lng;
				// this.city = position.city;
				this.setMap();
			},
			showErr(e) {
				console.log("定位失败", e);
				this.getMyLocation(); //定位失败再请求定位，测试使用
			},
			//位置信息在地图上展示
			setMap() {
				//步骤：定义map变量 调用 qq.maps.Map() 构造函数   获取地图显示容器
				//设置地图中心点
				var myLatlng = new qq.maps.LatLng(this.latitude, this.longitude);
				//定义工厂模式函数
				var myOptions = {
					zoom: 13, //设置地图缩放级别
					center: myLatlng, //设置中心点样式
					mapTypeId: qq.maps.MapTypeId.ROADMAP //设置地图样式详情参见MapType
				}
				// //获取dom元素添加地图信息
				var map = new qq.maps.Map(document.getElementById("container1"), myOptions);
				//给地图添加点击事件

				//给定位的位置添加图片标注
				var marker = new qq.maps.Marker({
					position: myLatlng,
					map: map
				});
				// `````````````
				var that = this;
				if (that.longitude == '') {
					var center = new qq.maps.LatLng(34.34281541842994, 108.93970884382725);
				} else {
					var center = new qq.maps.LatLng(that.latitude, that.longitude);
				}

				var map = new qq.maps.Map(document.getElementById("container1"), {
					center: center,
					zoom: 13
				});
				var marker = new qq.maps.Marker({
					position: center,
					map: map
				});
				var latlngBounds = new qq.maps.LatLngBounds();
				qq.maps.event.addListener(map, "click", function(event) {
					console.log(event, qq.maps);
					that.longitude = event.latLng.getLng(); // 经度
					that.latitude = event.latLng.getLat(); // 纬度
					jsonp('https://apis.map.qq.com/ws/geocoder/v1/?location=' + event.latLng.getLat() + ',' + event
						.latLng.getLng() + '&key=SZWBZ-QDWC3-M233R-YDXW5-TZT7Q-S4FJ7&get_poi=1&output=jsonp', {
							myCustomUrlParam: 'veryNice'
						}).then(response => {
						console.log('response', response)
						that.address = response.result.formatted_addresses.recommend

					}).catch(error => {
						// handle error
					}).then(() => {
						// always executed
					});
					if (markersArray) {
						for (let i in markersArray) {
							markersArray[i].setMap(null);
						}
					}
					if (!marker) {
						marker = new qq.maps.Marker({
							map: map,
							position: event.latLng
						});
					} else {
						marker.setPosition(event.latLng)
					}
					
					// var marker = new qq.maps.Marker({
					// 	map: map,
					// 	position: event.latLng
					// });
					// markersArray.push(marker);

				});
				geocoder = new qq.maps.Geocoder({
					complete: function(result) {
						console.log(result);
						that.longitude = result.detail.location.lng;
						that.latitude = result.detail.location.lat;
						map.setCenter(result.detail.location);
						var marker = new qq.maps.Marker({
							map: map,
							position: result.detail.location
						});
						markersArray.push(marker);
					}
				});
			},
			// 地图定位
			selectDt() {
				console.log(this.address, this.address.replace(/^\s+|\s+$/gm, ''))

				if (this.address == '') {
					this.$notify({
						title: '提示',
						duration: 1800,
						message: '请输入详细地址',
						type: 'warning'
					});
					return
				} else {
					var add = this.province + this.city + this.district + this.address
					let that = this
					jsonp('https://apis.map.qq.com/ws/geocoder/v1/?address==' + add +
						'&key=SZWBZ-QDWC3-M233R-YDXW5-TZT7Q-S4FJ7&get_poi=1&output=jsonp', {
							myCustomUrlParam: 'veryNice'
						}).then(response => {
						// handle success
						if (response.message == '查询无结果') {
							this.$notify({
								title: '提示',
								duration: 1800,
								message: '详细地址输入有误，请重新输入',
								type: 'warning'
							});
							return
						}
						console.log('response', response)
						that.longitude = response.result.location.lng; // 经度
						that.latitude = response.result.location.lat; // 纬度
						// that.address = response.result.address_components.province + response.result.address_components
						// 	.city + response.result.address_components.district + response.result.title
						that.setMap()
					}).catch(error => {
						// handle error
					}).then(() => {
						// always executed
					});
				}

			},
			// 
			userBtn(index){
				this.page1 = 1
				this.campus = ''
				this.phoneU = ''
				this.laundryIdU = ''
				this.adds = 2
				this.dataSelectUser()
				this.dialogFormVisible = true
			},
			userBtns2(row){
				this.userId = row.userId
				this.userName = row.nickName
				this.dialogFormVisible = false
			},
		},
		mounted() {
			this.parentId = ''
			this.homeSelect()
			this.xianshi()
		}
	}
</script>

<style>
	.customWidth {
		width: 80% !important;
	}

	.adver_main.box {
		display: block;
		max-width: 100%;
		text-align: center;
		border: 1px dotted rgba(67, 79, 103, .4);
	}

	.cards {
		padding: 0 8px;
		margin-bottom: 15px;
	}

	.adver_main.box a {
		display: flex;
		justify-content: center;
		height: 150px;
		line-height: 150px;
		text-decoration: none
	}

	.bannerManin {
		border: 1px solid #e8e8e8;
		font-size: 14px;
		padding: 0 24px;
		display: flex;
		justify-content: center;
		align-items: center;
		height: 113px;
		color: rgba(0, 0, 0, .65);
	}

	.bannerManin span {
		display: inline-block;
		margin-left: 5px;
	}

	.bannerManin img {
		width: 48px;
		height: 48px;
		border-radius: 50%;
	}

	.bannerbtn {
		display: flex;
		border-top: none !important;
		border: 1px solid #e8e8e8;
		padding: 11px;
		font-size: 14px;
		color: #3E8EF7;
	}

	.bannerbtn a {
		flex: 1;
		text-align: center;
		color: #3E8EF7 !important;
		text-decoration: none;
	}

	.imgs {
		position: relative;
		border-radius: 6px;
		width: 148px;
		height: 148px;
		margin-right: 10px;
		display: inline-block;
	}

	.dels {
		position: absolute;
		top: 0;
		left: 0;
		display: none;
	}

	.dels .el-icon-delete {
		line-height: 148px;
		padding-left: 58px;
		font-size: 25px;
		color: #fff;
	}

	.imgs:hover .dels {
		width: 100%;
		height: 100%;
		background: #000;
		display: block;
		opacity: 0.5;
	}

	.bqList {
		padding: 4px 14px;
		margin: 4px;
		border: 1px solid #efefef;
		font-size: 12px;
		color: #999;
		border-radius: 4px;
		margin-right: 15px;
	}

	.delss {
		display: none;
		position: relative;
	}

	.delss .el-icon-delete {
		position: absolute;
		top: 0;
	}

	.bqList:hover .delss {
		display: initial;
		opacity: 0.5;

	}

	.tj {
		padding: 6px !important;
		margin: 4px;
		font-size: 12px;
		border: 1px solid #ccc;
		border-radius: 4px;
	}
</style>